#include "stdafx.h"
#include "coresettings.h"

#include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
#include <QtOpenGL/QGLBuffer>

namespace Core {

CoreSettings *CoreSettings::instance()
{
    static CoreSettings global;
    return &global;
}

CoreSettings::CoreSettings()
{
    _width = 800;
    _height = 600;
    _isFullscreen = true;
}

CoreSettings::~CoreSettings()
{
}

void CoreSettings::readSystemSettings()
{
    QDesktopWidget *w = QApplication::desktop();
    _width = w->width();
    _height = w->height();
    _isFullscreen = true;
}

void CoreSettings::setSettings(int width, int height, bool isFullscreen)
{
    _width = width;
    _height = height;
    _isFullscreen = isFullscreen;
}

bool CoreSettings::isFullscreen() const
{
    return _isFullscreen;
}

int CoreSettings::windowHeight() const
{
    return _height;
}

int CoreSettings::windowWidth() const
{
    return _width;
}

} // Core
